<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>某某手机设计公司企业官网-模板之家</title>
    ﻿<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate icon" type="image/png" href="images/favicon.png">
<link rel='icon' href='favicon.ico' type='image/x-ico' />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="css/default.min.css?t=227" />
<!--[if (gte IE 9)|!(IE)]><!-->
<script type="text/javascript" src="lib/jquery/jquery.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="lib/amazeui/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<script type="text/javascript" src="lib/handlebars/handlebars.min.js"></script>
<script type="text/javascript" src="lib/iscroll/iscroll-probe.js"></script>
<script type="text/javascript" src="lib/amazeui/amazeui.min.js"></script>
<script type="text/javascript" src="lib/raty/jquery.raty.js"></script>
<script type="text/javascript" src="js/main.min.js?t=1"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
	<script src="js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="css/index.css"/>
	<link rel="stylesheet" href="css/style.css" />

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="css/xiaomi.css"/>
	<script src="img/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/xiaomi.js" type="text/javascript" charset="utf-8"></script>
</head>
<script type="text/javascript">
	function checkUsername(){
	var username=document.getElementById("username").value;
	var userreg=/^\w{6,12}$/;
	if(username==""){
		alert("姓名不能为空");
	}else if(userreg.test(username)==false){
	alert("姓名不符合要求，应在6-12位字符之间");
	}else{
	return true;
	}
	}
	function checkTel(){
	var tel=document.getElementById("tel").value;
	var telreg=/^1(3|4|5|6|7|8|9|)\d{9}$/;
	if(tel==""){
		alert("手机号不能为空");
	}else if(telreg.test(tel)==false){
	alert("手机号不符合要求，应在11位字符");
	}else{
	return true;
	}
	}
	function checkEmail(){
	var email=document.getElementById("email").value;
	var emailreg=/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
	if(email==""){
		alert("邮箱不能为空");
	}else if(emailreg.test(email)==false){
	alert("邮箱不符合要求");
	}else{
	return true;
	}
	}
	function checkContent(){
	var content=document.getElementById("content").value;
	if(content==""){
		alert("内容不能为空");
	}else{
	return true;
	}
	}
	function addMessage(){
	var username=document.getElementById("username").value;
	var tel=document.getElementById("tel").value;
	var email=document.getElementById("email").value;
	var content=document.getElementById("content").value;
	if(checkUsername()&&checkTel()&&checkEmail()&&checkContent()){
	$.post("MessageServlet",{
	"username":username,
	"tel":tel,
	"email":email,
	"content":content
	},function(res){
	if(res.success){
	alert(res.message);
	}else{
	alert(res.message);
	}
	},'json')
	}
	}
</script>
<body>
<jsp:include page="head.jsp"></jsp:include>

<div>
    <header class="header-article-list">
        <h1>在线留言</h1>

    </header>
<div>
   <form class="message-form" method="post" >

       <label>姓名
           <input type="text" name="username" id="username">
           <span>*</span>
       </label>


       <label>电话
           <input type="text" name="tel"id="tel">
           <span>*</span>
       </label>


       <label>邮箱
           <input type="email" name="email" id="email">
           <span>*</span>
       </label>


       <label>内容
           <textarea id="content"></textarea>
           <span>*</span>
       </label>


       <button type="button" class="am-btn am-btn-danger" onclick="addMessage()">提交</button>
   </form>
</div>
</div>
﻿<footer>
    <div>
        <div class="footer-info">
            <div class="footer-content">
                <img src="images/qccode.png" alt="">
               <div>
                <p>招商热线:0714-8868331</p>
                <div class="footer-box">
                    <i class="icon-tel"></i>
                    <span>公司电话:</span>
                    <span>17648378485</span>
                </div>
                <div class="footer-box">
                    <i class="icon-email"></i>
                    <span>公司邮箱:</span>
                    <span>3843434324@dayeyunalading.com</span>
                </div>
                <div class="footer-box">
                    <i class="icon-address"></i>
                    <span>公司地址:</span>
                    <span>河南省郑州市新郑市龙湖镇沙窝李祥云路</span>
                </div>
               </div>
            </div>
        </div>
        
</footer>
</body>
</html>